<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>String数据类型的转换</title>
</head>
<body>
  <script>
    //第一种方法 String()
    var b1 = true;
    var s1 = String(b1);
    console.log(typeof s1)
    //第二种方法
    var b2 = false;
    var s2 = b2.toString();
    console.log(typeof b2);
  </script>
</body>
</html>